#include <stdio.h>
#include <unistd.h>

int g_Val = 10;

int main()
{
    pid_t ret =fork();
    if(ret < 0)
    {
        return ret;
    }
    if(ret > 0)
    {
        sleep(2);
        printf("father [%d]-[%d]- g_Val = [%d][%p]\n", getpid(), getppid(), g_Val, &g_Val);
    }
    else
    {
        //g_Val = 100;
        printf("child [%d]-[%d]- g_Val = [%d][%p]\n", getpid(), getppid(), g_Val, &g_Val);
    }
    return 0;
}
